@import './variables.scss';
#app {

  .main-container {
    min-height: 100%;
    transition: margin-left .28s;
    margin-left: $sideBarWidth;
    position: relative;
  }

  .sidebar-container {
    // box-shadow: 0 0px 15px 0 rgba(0,0,0,0.04), 0 0 15px 0 rgba(0,0,0,0.04);
    box-shadow: 0 0px 10px rgba(0,0,0,0.1);
    transition: width 0.28s;
    width: $sideBarWidth ;
    background-color: $menuBg;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    .el-scrollbar__view {
      &>.el-menu {
        padding: 0 ;
      }
    }

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden ;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        // menu区域高度
        height: calc(100% - 144px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 16px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% ;
      // padding: 8px 0;
    }

    // menu hover
    .submenu-title-noDropdown,
    .el-submenu__title {
      height: 50px;
      line-height: 50px;
      padding-left: 10px ;
      &:hover {
        background-color: $menuHover ;
      }
    }
    .el-submenu .el-menu-item {
      height:36px;
      line-height: 36px;
    }
    .el-submenu__title {
      &:hover {
        background-color: $subMenuActiveBg ;
        & i {
          color: $subMenuActiveText ;
        }
        color: $subMenuActiveText ;
      }
      position: relative;
      // font-weight: 700;
      &+.el-menu {
        position: relative;
          &::before {
            content: '';
            display: block;
            width: 2px;
            // height: 90%;
            position: absolute;
            top: 12px;
            bottom: 2px;
            left: 34px;;
            background-color: $menuActiveDivBg;
            z-index: 1;
          }
      }
    }

    .is-active>.el-submenu__title {
      background-color: $subMenuActiveBg ;
      &::before {
        display: block;
        content: '';
        height:100%;
        position: absolute;
        width: 4px;
        left: 0;
        background-color: $subMenuActiveText;
      }
      // border-left: 4px solid $subMenuActiveText;
      & i {
        color: $subMenuActiveText ;
      }
      color: $subMenuActiveText ;
    }
    .menu_title {
      font-size: 15px ;
    }
    // 竖线
    // .el-submenu.is-active {
    //   &.is-opened {
    //     position: relative;
    //       &::before {
    //         content: '';
    //         display: block;
    //         width: 2px;
    //         height: 90%;
    //         position: absolute;
    //         top: 0;
    //         left: 0;
    //         // background-color: $menuActiveDivBg;
    //         background-color: #f00;
    //       }
    //   }
    // }

    & .nest-menu .el-submenu>.el-submenu__title,
    & .el-submenu .el-menu-item {
      min-width: $sideBarWidth ;
      background-color: $subMenuBg ;
      .menu_title{
          font-size: 14px;
      }
      .menu_item_div {
        display: inline-block;
          height: 34px;
          line-height: 34px;
          padding-left: 16px;
          width: 177px;
          border-radius: 6px;
      }
      &.is-active {
        .menu_item_div {
          background-color: $menuActiveDivBg;
        }
      }
      &:hover {
        .menu_item_div {
          background-color: $menuActiveDivBg;
          color: $menuActiveText;
        }
        background-color: $subMenuHover ;
      }
    }
  }
  .CollapseTransiton{
    left: $sideBarWidth
   }
  .hideSidebar {
    .sidebar-container {
      width: #{$sideBarCollapseWidth};
    }

    .main-container {
      margin-left: #{$sideBarCollapseWidth};
    }
    .CollapseTransiton {
      left: #{$sideBarCollapseWidth};
    }
    .submenu-title-noDropdown {
      padding: 0 ;
      position: relative;

      .el-tooltip {
        padding: 0 ;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      &>.el-submenu__title {
        padding: 0 ;

        .svg-icon {
          margin-left: 20px;
        }

        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        &>.el-submenu__title {
          & span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-submenu {
    min-width: $sideBarWidth ;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }
    .CollapseTransiton {
      left: 0px;
    }
    .sidebar-container {
      transition: transform .28s;
      width: $sideBarWidth ;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu-item {
  padding-left: 49px ;
}
.el-menu--vertical {
  z-index: 100002 !important;
  .el-menu {
    width: 180px ;
  }
  & .el-submenu__title,
    & .el-menu-item {
      // min-width: $sideBarWidth ;
      background-color: $subMenuBg ;
      padding-left: 10px !important;
      padding-right: 0px !important;
      width: 100% !important;
      .menu_item_div {
        display: inline-block;
          height: 34px;
          line-height: 34px;
          padding-left: 16px;
          width: 177px;
          border-radius: 6px;
      }
      &.is-active {
        .menu_item_div {
          background-color: $menuActiveDivBg;
        }
      }
      &:hover {
        .menu_item_div {
          background-color: $menuActiveDivBg;
          color: $menuActiveText;
        }
        background-color: $subMenuHover ;
      }
    }


  &>.el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .nest-menu .el-submenu>.el-submenu__title,
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
      background-color: $menuHover ;
    }
  }

  // the scroll bar appears when the subMenu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
